export default function throttle(fn,wait) {
  let timer = null;

  return function () {
    if (!timer) {
      timer = setTimeout(()=>{
        fn.apply(this,Array.prototype.slice.call(arguments, 0));
        timer = null;
      }, wait)
    }
  }
}

